<?php
/**
 * Created by IntelliJ IDEA.
 * User: kaireewu
 * Date: 11-9-29
 * Time: 下午2:35
 * To change this template use File | Settings | File Templates.
 */
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
define('IN_SYS', true);
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting(E_ALL);
if(PHP_VERSION < '5.3.0') {
    set_magic_quotes_runtime(0);
}
session_start();
define('SYS_ROOT',substr(dirname(__FILE__), 0, -3));
define('INC_DIR', SYS_ROOT . 'inc/');
define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
define('ICONV_ENABLE', function_exists('iconv'));
define('MB_ENABLE', function_exists('mb_convert_encoding'));
define('EXT_OBGZIP', function_exists('ob_gzhandler'));
define('TIMESTAMP', time());

if(function_exists('date_default_timezone_set')) {
    @date_default_timezone_set('Asia/Chongqing');
}

if(!defined('CORE_FUNCTION') && !include_once(INC_DIR . 'function.inc.php')) {
    exit('function.inc.php is missing');
}

$sitePath = get_site_url();
$pageTitle = $appName = "";
$appName = "ISUX"; // TODO: 写死的appName改成可配置

$user = NULL;
$logined = checkLogin();
$db = null;
try {
    $db = new PDO("sqlite:".SYS_ROOT."db/data.db");
} catch (PDOException $e) {
    exit($e->getMessage());
}
